package pruebas;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.net.Socket;



public class Monitor {
	
	public static void main (String[]arg) throws IOException
	{
		System.out.println("monitor haciendo ping al minga");
		
		
		Socket clientSocket = new Socket("127.0.0.1", 10002); 
		PrintWriter outToClient = new PrintWriter(clientSocket.getOutputStream(), true);
		
		
				
		outToClient.println("ping");
		
		BufferedReader inFromClient = new BufferedReader(new
				InputStreamReader(clientSocket.getInputStream())); 

			
		String s = inFromClient.readLine();
		System.out.println(s);
		clientSocket.close();

		System.out.println("monitor termina");
		
		
	}
		

}
